import Vue from 'vue'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import store from './store'
import App from './App.vue'
import router from './router'
import '@/assets/style/base.scss';
import "vue-easytable/libs/theme-default/index.css";
import VueEasytable from "vue-easytable";
import { VeLocale } from "vue-easytable";
import zhCN from "vue-easytable/libs/locale/lang/zh-CN.js";
import '@/utils/dialogDrag.js';
import Vue2OrgTree from 'vue2-org-tree';
import 'vue2-org-tree/dist/style.css'
import XLSX from 'xlsx';
import { saveAs } from 'file-saver';

import { LineChart, PieChart } from 'echarts/charts';
import { 
  LegendComponent, 
  TooltipComponent, 
  GridComponent,
  TitleComponent,
  DataZoomComponent,
  ToolboxComponent ,
  MarkPointComponent   
} from 'echarts/components';
import * as echarts from 'echarts/core';
import { CanvasRenderer } from 'echarts/renderers';

// 注册必要的组件
echarts.use([
  LineChart,
  PieChart,
  LegendComponent,
  TooltipComponent,
  GridComponent,
  TitleComponent,
  DataZoomComponent,
  ToolboxComponent,
  MarkPointComponent,
  CanvasRenderer,
]);

Vue.prototype.$echarts = echarts;
Vue.prototype.$xlsx = XLSX;
Vue.prototype.$saveAs = saveAs;

Vue.use(ElementUI)
Vue.use(VueEasytable);
VeLocale.use(zhCN);
Vue.use(Vue2OrgTree)

// 添加事件总线
Vue.prototype.$bus = new Vue()



new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')